export default (Vue) => {
  const requireComponent = require.context(
    '@/components',
    true,
    /\.(vue)$/
  )
  const components = requireComponent.keys()
  components.forEach((componentPath) => {
    const component = requireComponent(componentPath).default
    Vue.component(component.name, component) // 注册全局组件
  })
}
